//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#include <elatypes.h>
extern "C" void * __cdecl ela_malloc(size_t size);
extern "C" void   __cdecl ela_free(void * p);

void * __cdecl operator new(size_t size)
{
    return ela_malloc(size);
}

void * __cdecl operator new[](size_t size)
{
    return ela_malloc(size);
}

void __cdecl operator delete(void *p)
{
    /* The C++ standard states that delete of a NULL pointer
     * must be harmless.
     */
    if (p != NULL) {
        (void)ela_free(p);
    }
    return ;
}

void __cdecl operator delete[](void *p)
{
    /* The C++ standard states that delete of a NULL pointer
     * must be harmless.
     */
    if (p != NULL) {
        (void)ela_free (p);
    }
    return ;
}

void* __cdecl operator new(size_t, void* _location)
{
    return _location;
}

void __cdecl operator delete(void*, void*)
{
}

